<?php
/**
 * Created by PhpStorm.
 * User: yellow
 * Date: 2019/7/15
 * Time: 12:31
 */

namespace app\common\model;


use think\Model;

class BusDriver extends Model
{

    public function business(){
        return $this->hasOne('bus_business', 'id', 'business_id')
                    ->bind([
                        'business_name'=>'name'
                    ]);
    }

    public function getLicenseAttr($value){
        $host = getImgUrl();
        return $host . "/" .$value;
    }

    public function getHeadImgAttr($value){
        $host = getImgUrl();
        return $host . "/" .$value;
    }

    public function getStatusAttr($value){
        $statusArr = ['已冻结', '已通过', '已冻结'];
        return $statusArr[$value];
    }

}